﻿@{
    Layout = "_AccountLayout";
    ViewData["Title"] = "忘记 密码";

}
<div class="passwordBox animated fadeInDown">
    <div class="row">

        <div class="col-md-12">
            <div class="ibox-content">
                <h2 class="font-bold">@ViewData["UserName"]找回密码</h2>
                <p>
                    请输入您的新密码。
                </p>
                <div class="row">
                    <div class="col-lg-offset-1 col-md-10">

                        <form asp-controller="Account" asp-action="ChangePassword" asp-route-returnurl="@ViewData["ReturnUrl"]" method="post" class="form-horizontal" role="form">
                            <input type="hidden" name="token" value="@ViewData["Token"]" />
                            <input type="hidden" name="UserName" value="@ViewData["UserName"]" />
                            <div asp-validation-summary="@ValidationSummary.All" class="text-danger"></div>
                            <div class="form-group">
                                <div class="col-md-12">
                                    <div class="input-group  m-b col-md-12">
                                        <input name="Password" id="Password" type="password" validate="{required:true,minlength:6,maxlength:16}" class="form-control" placeholder="输入您的新密码">
                                        <span class="text-danger field-validation-valid"></span>
                                    </div>
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="col-md-12">
                                    <div class="input-group  m-b col-md-12">
                                        <input name="RePassword" id="RePassword" type="password" validate="{required:true,equalTo:'#Password'}" class="form-control" placeholder="确认密码">
                                        <span class="text-danger field-validation-valid"></span>
                                    </div>
                                    </div>
                                </div>
                            <div class="form-group">
                                <div class="col-md-12">
                                    <div class="input-group m-b col-md-12">
                                        <input name="mailVerCode" id="mailVerCode" validate="{required:true,maxlength:6,stringEn:true}" maxlength="6" value="@ViewData["MailVerCode"]" class="form-control" placeholder="邮箱验证码">

                                        <span class="text-danger field-validation-valid"></span>
                                    </div>
                                    </div>
                                </div>
                            <div class="form-group">
                                <div class="col-md-12">
                                    <div class="input-group m-b ">
                                        <input name="VerCode" id="VerCode" validate="{required:true,maxlength:6,stringEn:true}" maxlength="6" class="form-control " placeholder="验证码">
                                        <div class="input-group-btn">
                                            <img class="btn btn-white vercode" title="验证码" style="margin:0;padding:0;height:35px;" src="~/api/VerificationCode?type=@ConfigHelper.RESET_PASSWORD_SEND_VER_CODE" />
                                            @*<button class="btn btn-white" type="button" aria-expanded="true">验证码</button>*@
                                        </div>
                                        </div>
                                    </div>
                                </div>
                                <button type="submit" class="btn btn-primary block full-width m-b">修改密码</button>

</form>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <hr />
    @await Html.PartialAsync("_LoginFooter")
</div>
@section scripts{
    <script type="text/javascript">
        $(".vercode").click(function () {
            $(".vercode").attr('src', "../api/VerificationCode?time=" + Math.random() + "&type=@ConfigHelper.RESET_PASSWORD_SEND_VER_CODE");
        });
        var form = $(".form-horizontal").CustomForm({ IsValidate: true });
        $(".form-horizontal").submit(function () {
            if (!$(".form-horizontal").valid()) {
                return false;
            }
        });
    </script>

}
